<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JavaScript RegExp 对象</title>

    <script>
        var exp = new RegExp("@");
        var ret = exp.exec("abcd")

        document.writeln(ret);
        document.writeln(exp.test("123456@qq.com"))
                  //(\w+)    (@)([\w]+)(.)(com|cn|ltd)
        var arr = '122162005  @ qq . com'.replace(/[A-z]+/g, "*******");
        document.writeln(arr);  // "abcd"
        document.writeln(typeof arr);
        function pre() {
            history.back()
        }
    </script>

</head>
<body>
<button onclick="pre()">返回上一页</button>
</body>
</html>